import java.util.Arrays;

public class Test {

    public static void main(String[] args) {
       int[] arr = {1,2,4,7,9} ;
        System.out.println(oddNum(arr));

    }
    public static boolean oddNum(int[] array){
        if(array == null) return false ;
        if(array.length < 3) return false ;
        int count = 0 ;
        for (int num : array) {
            if(num % 2 != 0){
                count ++ ;
            }else{
                count = 0 ;
            }
            if(count == 3){
                return true ;
            }
        }
        return false ;
    }


    public static void main4(String[] args) {
         int[] array  = {1 ,2,3,3,1,4,5,4,5} ;
        System.out.println(oneNum(array));

    }
    public static int oneNum(int[] array){
        if(array == null) return -1 ;
        int tmp = array[0] ;
        for (int i = 1; i < array.length; i++) {
            tmp = tmp ^ array[i] ;
        }
        return tmp ;
    }

    public static void main2(String[] args) {
        int[] array = { 1,5,3,7,2,6} ;
        bubbleSort(array);
        System.out.println(Arrays.toString(array));
    }
    public static void bubbleSort(int[] array){
        if(array  == null) return ;
        for (int i = 0; i < array.length - 1; i++) {
            boolean flg = false ;
            for (int j = 0; j < array.length - 1 - i; j++) {
                if(array[j] > array[j + 1]){
                    int tmp  = array[j] ;
                    array[j] = array[j + 1] ;
                    array[j + 1] = tmp ;
                    flg = true ;
                }
            }
            if(flg == false){
                break ;
            }
        }



    }

}
